From edd2f24b6ed362221661009c73245d9d4d616f66 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 1 Jun 2011 21:56:13 +0200 Subject: [PATCH] notebook: Compute tab width in a simpler way This code should be more obvious: The check only needs to check for scrollable widgets, and only needs to compare to tab_width. As a side note, for vis_pages == 1, tab_width will be smaller than tab_max + stuff, so this code will not behave differently. --- gtk/gtknotebook.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 1aabc6a69f..bab4e07323 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -2136,9 +2136,9 @@ gtk_notebook_size_request (GtkWidget *widget, page->requisition.height = tab_height; } - if (priv->scrollable && vis_pages > 1 && - requisition->width < tab_width) - tab_width = tab_max + 2 * (scroll_arrow_hlength + arrow_spacing); + if (priv->scrollable) + tab_width = MIN (tab_width, + tab_max + 2 * (scroll_arrow_hlength + arrow_spacing)); action_width += action_widget_requisition[ACTION_WIDGET_START].width; action_width += action_widget_requisition[ACTION_WIDGET_END].width; @@ -2184,9 +2184,9 @@ gtk_notebook_size_request (GtkWidget *widget, tab_height += page->requisition.height; } - if (priv->scrollable && vis_pages > 1 && - requisition->height < tab_height) - tab_height = tab_max + (2 * scroll_arrow_vlength + arrow_spacing); + if (priv->scrollable) + tab_height = MIN (tab_height, + tab_max + (2 * scroll_arrow_vlength + arrow_spacing)); action_height += action_widget_requisition[ACTION_WIDGET_START].height; action_height += action_widget_requisition[ACTION_WIDGET_END].height; -- 2.30.2